package com.ms.education.ucenter.service.feign;

import com.ms.education.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>Project:education-AclFeignService
 * <p>Powered by ms on 2023-02-27 06:17:09
 *
 * @author ms
 * @version 1.0
 * @since 1.8
 */
@Component
@FeignClient(value = "service-acl")
public interface AclFeignService {

    @ResponseBody
    @GetMapping("/acl/role/getRoleAndPermission/{userId}")
    public R getRoleAndPermission(@PathVariable("userId") Integer userId);

    @PostMapping("/acl/role/endowedUserRole/{userId}")
    public R endowedUserRole(@PathVariable("userId") Integer userId,
                             @RequestBody Integer[] roleIds);

    @GetMapping("/acl/sa-token/getUserRoles/{userId}")
    public List<String> getUserRoles(@PathVariable("userId") Integer userId);


    @GetMapping("/acl/sa-token/getUserPermissions/{userId}")
    public List<String> getUserPermissions(@PathVariable("userId") Integer userId);

    @GetMapping("/acl/sa-token/getPermissionByRoleName/{roleName}")
    public List<String> getPermissionByRoleName(@PathVariable("roleName") String roleName);


}
